#ifndef UNITEMITTER_H
#define UNITEMITTER_H

#include "utilities.h"
#include "entity.h"
#include <QQueue>

class UnitEmitter : public Entity
{
public:
   UnitEmitter(const qint32 ID=0);

   virtual void tick(const qreal timeDelta);
   virtual void think();

   void enqueueSquad(const EntitySquadType &squad);

   QPointF emitPosition();
   void setEmitPosition(const QPointF &position);

   quint32 capacity();
   void setCapacity(const quint32 capacity);

   qreal rate();
   void setRate(const qreal rate);

   QString pathName();
   void setPathName(const QString &path);

   virtual void marshall(const EVENT_TYPE event, QDataStream &data);
   virtual void demarshall(const EVENT_TYPE event, QDataStream &data, const quint32 playerID=0);

protected:
   void emitNextSquad();
   quint32 mCapacity;
   QQueue<EntitySquadType> mQueue;
   qreal mEmitRate;
   QString mPathName;
   QPointF mEmitPosition;
};

#endif
